package com.kevin.service;

import com.alibaba.fastjson.JSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.stereotype.Service;

/**
 * @author kevin
 * @version V1.0
 * @Description: TODO
 * @date 2019/1/30 14:56
 **/
@Service
public class MessPushService {
    @Autowired
    private SimpMessagingTemplate simpMessagingTemplate;

    public void pushData(Object data){
        simpMessagingTemplate.convertAndSend("/topic/kmeans", JSON.toJSONString(data));
    }
}
